package com.oak.broke.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * @author tanghan
 * @Description mvc配置
 * @date 2023/04/23/ 10:03:00
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Autowired
    private List<HandlerInterceptor> handlerInterceptorList;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        for (HandlerInterceptor handlerInterceptor : handlerInterceptorList) {
            registry.addInterceptor(handlerInterceptor);
        }
    }
}
